<?php
/**
 * テストフォームコントローラー
 *
 * @package  app
 * @extends  Controller
 */
class Controller_Manage_Debug extends Controller {
	/**
	 * index
	 *
	 * @access  public
	 * @return  Response
	 */
	public function action_index() {
		$post = Input::post();
		
		$action = isset($post['action']) ? $post['action'] : '';
		
		// ログインボーナス取消
		if( $action == 'login_bonus_del') {
			$query = DB::update('member_point');
			$query -> set(array('create_date' => DB::expr('DATE_SUB(create_date,INTERVAL 1 DAY)') ));
			$query -> where('create_date', '>', DB::expr('DATE_SUB(NOW(),INTERVAL 1 DAY)'));
			$query -> where('key1', 'login_bonus');
			$query -> where('member_id', $post['member_id']);
			$query -> execute();
		}
		
		return Response::forge(View::forge('manage/debug/index'), D_HTTP_UPDATE);
	}

}
